package com.wanmait.myhouse.webController;

import com.wanmait.myhouse.dao.HouseDAO;
import com.wanmait.myhouse.vo.House;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("web")
public class WebSingleController {
    @GetMapping("single")
    public String single(House house, Model model){
        HouseDAO houseDAO = new HouseDAO();
        House houses = houseDAO.FindById(house.getId());
        model.addAttribute("houses",houses);
        return "web/single";
    }
}
